-- GENERATED SPELL FOR [Phasing Stalker] --


function spell0_18559(pUnit, Event) --@Serpent Sting,n/a--
pUnit:FullCastSpellOnTarget(31975,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18559', 15000, 1)
end

function spell1_18559(pUnit, Event) --@Serpent Sting,n/a--
pUnit:FullCastSpellOnTarget(35511,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18559', 15000, 1)
end

function spell2_18559(pUnit, Event) --@Shoot,n/a--
pUnit:FullCastSpellOnTarget(15547,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18559', 577, 1)
end

function spell3_18559(pUnit, Event) --@Shoot,n/a--
pUnit:FullCastSpellOnTarget(16100,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18559', 590, 1)
end

function spell4_18559(pUnit, Event) --@Spirit Vengeance,n/a--
pUnit:FullCastSpellOnTarget(32829,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18559', 10500, 1)
end

function spell5_18559(pUnit, Event) --@Viper Sting,Drain--
pUnit:FullCastSpellOnTarget(37551,pUnit:GetRandomPlayer(4))
pUnit:RegisterEvent('Sorts_18559', 8000, 1)
end

function Sorts_18559(pUnit, Event)
local choix_sorts_18559 = math.random(0, 5)
if choix_sorts_18559 == 0 then
pUnit:RegisterEvent('spell0_18559', 1, 1)
end
if choix_sorts_18559 == 1 then
pUnit:RegisterEvent('spell1_18559', 1, 1)
end
if choix_sorts_18559 == 2 then
pUnit:RegisterEvent('spell2_18559', 1, 1)
end
if choix_sorts_18559 == 3 then
pUnit:RegisterEvent('spell3_18559', 1, 1)
end
if choix_sorts_18559 == 4 then
pUnit:RegisterEvent('spell4_18559', 1, 1)
end
if choix_sorts_18559 == 5 then
pUnit:RegisterEvent('spell5_18559', 1, 1)
end
end

function mob18559_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18559', math.random(1500, 3000), 1)
end

function mob18559_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18559_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18559_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18559, 1, 'mob18559_Action')
RegisterUnitEvent(18559, 2, 'mob18559_Leave')
RegisterUnitEvent(18559, 3, 'mob18559_Kill')
RegisterUnitEvent(18559, 4, 'mob18559_Die')
